Skip to content

fix(drizzle): pagination applied incorrectly when sorting by a field inside an array field#15908

Merged
r1tsuu merged 1 commit intomainfrom
fix/sorting
Mar 19, 2026
Merged

fix(drizzle): pagination applied incorrectly when sorting by a field inside an array field#15908
r1tsuu merged 1 commit intomainfrom
fix/sorting

Conversation

@r1tsuu
Copy link
Member

@r1tsuu r1tsuu commented Mar 11, 2026

Fixes #14124

This PR changes select distinct usage in findMany to group by with min and max Specifically for cases when the sort query includes columns inside arrays to avoid duplicative results and so breaking the pagination.

@github-actions
Copy link
Contributor

📦 esbuild Bundle Analysis for payload

This analysis was generated by esbuild-bundle-analyzer. 🤖
This PR introduced no changes to the esbuild bundle! 🙌

@r1tsuu r1tsuu assigned DanRibbens and unassigned DanRibbens Mar 11, 2026
@r1tsuu r1tsuu requested a review from DanRibbens March 11, 2026 16:50
@r1tsuu r1tsuu merged commit 0f67215 into main Mar 19, 2026
155 checks passed
@r1tsuu r1tsuu deleted the fix/sorting branch March 19, 2026 18:40
@github-actions
Copy link
Contributor

🚀 This is included in version v3.80.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LocalAPI: paginated query with sorting on a field inside an array field does not retrieve all docs of the queried page

2 participants